// list.js
Page({
  data:{
    list:[],
    title:"loading...",
    loading:true
  },
  onLoad (params){
    const that = this
    const apiUrl = 'https://api.douban.com/v2/movie/' + params.type
    // console.log(list.type);
    wx.request({
      url: apiUrl,
      data: {},
      header: {
        "content-type": "application/text"
      },
      success: function (res) {
        that.setData({ 
          list: res.data.subjects,
          title: res.data.title,
          loading:false
          });
          // console.log(res.data);
      }
    })  
  }
})